-
Notifications
You must be signed in to change notification settings - Fork 296
feat:support --dependency-update before upgrade #774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
feat:support --dependency-update before upgrade #774
Conversation
Signed-off-by: kamilswiec <[email protected]>
@kamilswiec could you add some unit tests for this? |
@kamilswiec hi. I will merge this if you can add some tests for this feature. and releae new version. |
@kamilswiec ping. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for the --dependency-update
flag to the helm diff upgrade
command, allowing automatic dependency updates before diffing. This eliminates the need to manually run helm dep up chart
when chart dependencies are missing and ensures consistency with helm upgrade
command arguments.
- Added
--dependency-update
boolean flag to the diff command - Implemented dependency update execution before running the diff operation
- Added helper function to execute
helm dependency update
command
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
cmd/upgrade.go | Added dependencyUpdate flag field, command line flag registration, and logic to execute dependency update before diffing |
cmd/helm3.go | Added updateDependencies helper function to execute helm dependency update command |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
return err | ||
} else { | ||
fmt.Println(string(output)) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The 'else' clause is unnecessary here since the 'if' block returns early on error. Consider removing the 'else' and unindenting the output printing code for better readability.
} | |
} | |
fmt.Println(string(output)) |
Copilot uses AI. Check for mistakes.
if err != nil { | ||
return err | ||
} else { | ||
fmt.Println(string(output)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The dependency update output is printed to stdout without any context or formatting. Consider adding a prefix like 'Dependency update:' or using a logger to maintain consistency with other command output formatting in the codebase.
fmt.Println(string(output)) | |
log.Printf("Dependency update: %s", string(output)) |
Copilot uses AI. Check for mistakes.
When using
helm diff upgrade
command when chart dependencies incharts
are absent you have to add runhelm dep up chart
.I want to be able to pass most of the arguments that I also use in
helm upgrade
command. This allows me to reduce duplication and ensurehelm diff upgrade
uses the same flags ashelm upgrade
be passing the same${args}
variable.Tested with helm version
3.17.1
.